import { get, post } from '@/uitls/axios';


// 最新行情
export const queryLatestMarketConditionFnAPi = () => {
  return new Promise((resolve, reject) => {
    get('/apis/market/latestMarketCondition')
     .then((response) => {
        resolve(response);
      })
     .catch((error) => {
        reject(error);
      });
  });
};

//获取资产
export const queryAssetsFnAPi = () => {
  return new Promise((resolve, reject) => {
    get('/apis/memberAsset/getCurrencyPanel')
    .then((response) => {
        resolve(response);
      })
    .catch((error) => {
        reject(error);
      });
  });
};

//获取订单薄
export const queryOrderBookFnAPi = (data:any) => {
  return new Promise((resolve, reject) => {
    get('/exchange/trade/queryOrderBook',data)
    .then((response) => {
        resolve(response);
      })
    .catch((error) => {
        reject(error);
      });
  });
};


export const cancelOrderFnAPi = (data:any) => {
  return new Promise((resolve, reject) => {
    get('/exchange/trade/cancelOrder',data)
    .then((response) => {
        resolve(response);
      })
    .catch((error) => {
        reject(error);
      });
  });
};
//获取成交记录
export const queryTradeOrderFnAPi = (data:any) => {
  return new Promise((resolve, reject) => {
    get('/exchange/trade/queryTradeOrder',data)
    .then((response) => {
        resolve(response);
      })
    .catch((error) => {
        reject(error);
      });
  });
};
//下单
export const orderPlaceFnAPi = (data:any) => {
  return new Promise((resolve, reject) => {
    post('/exchange/trade/orderPlace',data)
    .then((response) => {
        resolve(response);
      })
    .catch((error) => {
        reject(error);
      });
  });
};
